package com.dindang.propertyfee.mvp.model.entity;

import java.io.Serializable;
import java.util.List;

import retrofit2.http.Field;

/**
 * Created by cxw on & 2018/11/22
 */
public class PropertyCharge {
    /**
     * 现金支付
     */
    public static class PayCashPara{
        public String ids;
        public String userid;
        public String userName;
        public String paymentName;
        }

    /**
     * 获取账单详情
     */
    public static class GetDetailPara{
        public String id;
    }

    public static class TotalData{
        public double price;
        public int childPosition;
        public Total total;

        public TotalData(double price, Total total) {
            this.price = price;
            this.childPosition = 1;
            this.total = total;
        }

        public void addTotal(Total total){
            this.price += total.total;
            this.childPosition += 1;
            this.total = total;
        }

    }
    /**
     * 总计吧
     */
    public static class Total{
        public int id;
        public String communityName;
        public String address;
        public double total;
        public String name;
        public String phone;
        public String paymentDate;
        public List<CostItem> costItems;
        public boolean isCheck;

        public Total(String address, double total, String name, String phone) {
            this.address = address;
            this.total = total;
            this.name = name;
            this.phone = phone;
            this.isCheck = false;
        }

        /**
         * 设置逾期测试数据
         * @param address
         * @param total
         * @param name
         * @param phone
         */
        public Total(String communityName, String address, double total, String name, String phone, String paymentDate) {
            this.communityName = communityName;
            this.address = address;
            this.total = total;
            this.name = name;
            this.phone = phone;
            this.paymentDate = paymentDate;
            this.isCheck = false;
        }

        /**
         * 设置逾期测试数据
         * @param address
         * @param total
         * @param name
         * @param phone
         */
        public Total(String address, double total, String name, String phone, String paymentDate) {
            this.address = address;
            this.total = total;
            this.name = name;
            this.phone = phone;
            this.paymentDate = paymentDate;
            this.isCheck = false;
        }


        public void setCostItems(boolean isCheck){
            for (CostItem costItem : costItems)
                costItem.isCheck = isCheck;
        }

        /**
         * 子类选中清空
         * @param isCheck
         * @param shoukuan
         */
        public void setCostItems(boolean isCheck, List<CostItem> shoukuan){
            for (CostItem costItem : costItems){
                costItem.isCheck = isCheck;
                if(costItem.isCheck){
                    shoukuan.add(costItem);
                }else{
                    shoukuan.remove(costItem);
                }
            }
        }
    }

    /**
     * 费项
     */
    public static class CostItem{
        public int id;
        public String item;
        public double cost;
        public boolean isCheck;

        public String dosage;
        public int newRead;
        public int oldRead;
        public String unitPrice;
        public String startData;
        public String endData;
        public boolean isDetailVisibility;//false隐藏

        public CostItem(String item, double cost) {
            this.item = item;
            this.cost = cost;
            this.isCheck = false;
        }

        public void setCostItemDetail(int id, String dosage, int newRead, int oldRead, String unitPrice, String startData, String endData) {
            this.id = id;
            this.dosage = dosage;
            this.newRead = newRead;
            this.oldRead = oldRead;
            this.unitPrice = unitPrice;
            this.startData = startData;
            this.endData = endData;
            this.isDetailVisibility = false;
        }
    }

    /**
     * 查询近期账单统计
     */
    public static class RecentCountParam{
        public int page;
        public int rows;
        public String corpId;
        public RecentCountParam() {
        }
    }

    /**
     * 查询近期账单统计数据
     */
    public static class RecentCount{
        public Recent today;
        public Recent tomorrow;
        public Recent sevenDay;
        public Recent thirtyDay;
        public Recent overdue;
    }

    /**
     * 查询近期账单统计数据子数据
     */
    public static class Recent{
        public String total;
        public double sumAmount;
        public String name;

        public String getName() {
            return name;
        }

        public void setName(String name) {
            this.name = name;
        }
    }

    /**
     * 查询逾期数据
     */
    public static class OverdueParam{
        public String rows;
        public String corpId;

        public OverdueParam(String rows,String corpId) {
            this.rows = rows;
            this.corpId=corpId;
        }
    }

    public static class Overdue{
        public String c_nodedate_id;
        public String bName;
        public String custName;
        public String c_telphone;
        public String c_fee_name;
        public String addr;
        public double amount;
        public int overdueDays;
    }

    /**
     * 查询近期账单
     */
    public static class RecentBillParam implements Serializable{
        public String startNum;
        public String endNum;
        public int page;
        public int rows;
        public String startDate;
        public String endDate;
        public String bid;
        public String nodeValue;
        public String likeValue;
        public String corpid;

        /**
         * 设置一页几条
         * @param rows 几条
         */
        public RecentBillParam(int rows) {
            this.startNum = "";
            this.endNum = "";
            this.page = 0;
            this.rows = rows;
            this.startDate = "";
            this.endDate = "";
            this.bid = "";
            this.nodeValue = "";
            this.likeValue = "";
            this.corpid = "";
        }

        public void setStartNum(String startNum, String endNum){
            this.startNum = startNum;
            this.endNum = endNum;
            this.page = 0;
        }

    }

    /**
     * 近期账单
     */
    public static class RecentBill{

        public PageData pageData;// 小区数据 哎~~~~
        public double sumAmount;// 金额合计

        public static class PageData{
            public int page;
            public int pageSize;
            public int total;// 多少户
            public List<Rows> rows;
        }

        public static class Rows{
            public String c_nodedate_id;
            public double amount;
            public String bName;
            public String custName;
            public String addr;
            public String c_telphone;
        }

    }

    /**
     * 根据nodedataid查询账单信息
     */
    public static class QueryByNodedataIdParam {
        public String nodedataId;
    }

    public static class NodedataDetail {
        public List<Bills> bills;
        public List<Info> info;

        public static class Bills{
            public String c_fee_name;
            public String c_quantity;
            public String d_modify_billing_date;
            public int overdueDays;
            public double c_uncollected_amount;
            public String c_name;
            public String d_end_billing_date;
            public String c_last_time_num;
            public int l_id;
            public String c_this_time_num;
            public boolean isCheck;
            public boolean isDetailVisibility;//false隐藏
        }

        public static class Info{
            public String custTel;
            public int custId;
            public String custName;
            public String addr;
        }
    }

    /**
     * 查询收费记录
     */
    public static class Record4ClientParam {
        public int page;
        public int rows;

        public Record4ClientParam(int rows) {
            this.rows = rows;
            this.page = 0;
        }
    }

    /**
     * 收费记录
     */
    public static class Record4Client {
        public int total;
        public long sumAmount;
        public String time;
        public List<FeeList> list;

        public static class FeeList {
            public String d_receipt_date;
            public String c_payment_no;
            public double amount;
            public String bName;
            public String l_id;
            public String custName;
            public String addr;
            public String c_telphone;
        }
    }

    public static class RecordDetailParam {
        public String id;
    }

    public static class RecordDetail {
        public String c_nodedate_id;
        public String d_receipt_date;
        public String c_payment_no;
        public String c_payment_name;
        public String c_corpid;
        public double c_paid_amount;
        public double countAmount;
        public String d_create_billing_date;
        public double c_price;
        public String d_end_billing_date;
        public String c_this_time_num;
        public String c_payee_name;
        public String c_quantity;
        public String bname;
        public String c_building_id;
        public int c_collection_type;
        public String c_corpName;
        public String c_fee_type_name;
        public String c_last_time_num;
        public String addr;
    }

    public static class RecordPrintStyle{
        public String content;
        public int fontSize;// 字体大小22~28  //字体大小26 一行14个中文 24 大概一行 16个中文 大概是384像素
        public int printGray;// 打印灰度0~7
        public boolean isBold;// 加粗
        public int algin;// 0 左, 1中, 2右
        public int leftIndent;
        public int lineSpace;// 行间距
        public int walkPaper;// 走纸
        public boolean isUnderline;// 下划线

        public RecordPrintStyle(String content, int fontSize, int printGray, boolean isBold, int algin, int leftIndent, int lineSpace, int walkPaper) {
            this.content = content;
            this.fontSize = fontSize;
            this.printGray = printGray;
            this.isBold = isBold;
            this.algin = algin;
            this.leftIndent = leftIndent;
            this.lineSpace = lineSpace;
            this.walkPaper = walkPaper;
        }

        public RecordPrintStyle(String content, int fontSize, int printGray, boolean isBold, int algin, int leftIndent, int lineSpace, int walkPaper, boolean isUnderline) {
            this.content = content;
            this.fontSize = fontSize;
            this.printGray = printGray;
            this.isBold = isBold;
            this.algin = algin;
            this.leftIndent = leftIndent;
            this.lineSpace = lineSpace;
            this.walkPaper = walkPaper;
            this.isUnderline = isUnderline;
        }
    }

}
